#include <stdio.h>
#include <string.h>

inline int max(int a, int b)
{
	return a > b ? a : b;
}

int max_sub(char *stra, int la,
	char *strb, int lb)
{
	if (la == 0 || lb == 0)
		return 0;
	if (stra[la - 1] == strb[lb - 1])
		return 1 + max_sub(stra, la - 1, strb, lb - 1);
	else 
		return max( max_sub(stra, la - 1, strb, lb),
			max_sub(stra, la, strb, lb - 1));
}

int main()
{
	int len;
	char stra[] = "a1b2c3de4fghab";
	char strb[] = "abcdefgh";
	len = max_sub(stra, strlen(stra), strb, strlen(strb));

	printf("stra:%s\n", stra);
	printf("strb:%s\n", strb);
	printf("len:%d\n", len);
	return 0;
}
